package org.tech4j.captcha.graphical.service;

import org.tech4j.captcha.api.model.CaptchaResponse;
import org.tech4j.captcha.graphical.config.CaptchaGraphicalConfig;
import org.tech4j.captcha.graphical.model.CheckCaptchaEntity;
import org.tech4j.captcha.graphical.model.GraphicalCaptchaEntity;
import org.tech4j.captcha.graphical.model.VerifyCaptchaEntity;
import org.tech4j.common.spi.SPI;

/**
 * @program: tech4j
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/4 16:20
 **/
@SPI
public interface CaptchaService {

    /**
     * 初始化
     * @param config
     */
    void init(CaptchaGraphicalConfig config);

    /**
     * 获取验证码
     * @param captchaEntity
     * @return
     */
    CaptchaResponse getCaptcha(GraphicalCaptchaEntity captchaEntity);

    /**
     * 验证码是否正确
     * @param captchaEntity
     * @return
     */
    CaptchaResponse checkCaptcha(CheckCaptchaEntity captchaEntity);

    /**
     * 验证码校验
     * @param captchaEntity
     * @return
     */
    CaptchaResponse verification(VerifyCaptchaEntity captchaEntity);
}

